// pages/index/replenishment/buhuo.js
var App = getApp();
var realOrderMoney = 0;//订单实际支付金额
let defaultLoad = true; //是否是默认加载数据
let firstClick = false;//是否是左侧导航的点击事件

Page({

  /**
   * 页面的初始数据
   */
  data: {
    user_isvip: false, //用户是否是vip
    noNetwork: false, //是否有网络
    currentPage: 1, //当前导航的位置
    schoolId: '',
    imgUrls: [],
    indicatorDots: false,
    autoplay: true,
    currentIndex: 0, //banner当前位置
    imgPreMargin: '', //banner前面露出的部分
    imgNextMargin: '', //banner后面露出的部分

    firstNav: [],
    listTitle: '',//显示的二级标题名称
    firstIndex: 0,
    goodsIndex: 0,//显示的商品列表的序列
    totalMoney: '0.00',//购物车总金额
    originRemainPrice:'0.00', //可补货额度
    remainPrice: '0.00',//剩余补货价格
    startSend: '0.00', //起送价
    totalNum: 0, //商品数量
    hoverAlert: false,//购物车列表
    shoppingCart: [],
    chaPrice:'0.00', // 差多少钱起送
    sureOderMsg: false , // 确定提交补货弹窗
    allListData:[], //所有数据，包含一级标题
    leftScroll:0,
    rightScroll:0,
    heightArr:[], //右边每个模块的高度
    showHotPackage: false, //是否显示最火套餐
    hotPackage:[], //最火套餐列表
    showHotDetail:false, //是否显示最火套餐详情
    hotDetailMsg:{}, //当前展示的最火套餐详情
    showFirstIntro: false,//首次补货引导
    showHotTip: true //是否显示最火套餐的气泡
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.showLoading({
      title: '加载中',
    })
    defaultLoad = true;
    this.getBanner();
    this.getBoxGoodsList(); //获取分类
    this.getBoxLimit();//获取盒子限制 

    if (wx.getStorageSync('comeSupply')<3){//判读是否是前三次进入补货商城
      wx.setStorageSync('comeSupply', parseInt(wx.getStorageSync('comeSupply') == '' ? 0 : wx.getStorageSync('comeSupply')) + 1);//记录进入补货商城的次数
      this.setData({
        showHotTip: true
      })
    }else{
      this.setData({
        showHotTip: false
      })
    }
    
  },

  // 导航切换
  navChange: function (e) {
    let index = e.currentTarget.dataset.index;
    let url = e.currentTarget.dataset.url;

    if (index != this.data.currentPage) {
      this.setData({
        currentPage: index
      })
      wx.reLaunch({
        url: url
      })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.setData({
      currentIndex: 0
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },

  //获取banner
  getBanner: function () {
    let that = this;
    wx.request({
      url: App.data.globalAPI + '/sideshow/banner/get',
      data: {
        type: 3,
        token: wx.getStorageSync('token'),
        support: 1 //0: 全部 1: 小程序 2: 安卓 3: IOS
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        if (res.data.error == 0) {
          wx.hideLoading();
          that.setData({
            noNetwork: false,
            imgUrls: res.data.data
          })
          //判断前后距离
          switch (that.data.imgUrls.length) {
            case 1:
              that.setData({
                imgPreMargin: '60rpx',
                imgNextMargin: ''
              })
              break;
            case 2:
              that.setData({
                imgNextMargin: '160rpx'
              })
              break;
            default:
              that.setData({
                imgPreMargin: '80rpx', //banner前面露出的部分
                imgNextMargin: '80rpx'
              })
              break;
          }
        } else {//登录过期
          wx.showToast({
            icon: 'none',
            title: res.data.msg,
          })
        }
      }
    })
  },
  //banner活动页跳转
  activeNavgator: function (e) {
    let url = e.currentTarget.dataset.url;
    if (url.indexOf('https://x.boxinschool.com') > -1) {
      wx.navigateTo({
        url: 'active_page?url=' + encodeURIComponent(url),
      })
    }
    if (url == 'www.maohesharejudge.com') {
      wx.navigateTo({
        url: '/pages/mine/setting/recommend',
      })
    }
  },

  //banner切换
  swiperChange: function (e) {
    this.setData({
      currentIndex: e.detail.current
    })
    //判断前后距离
    if (this.data.currentIndex >= 1) {
      if (this.data.imgUrls.length == 2) {
        this.setData({
          imgPreMargin: '140rpx',
          imgNextMargin: '20rpx'
        })
      }
    } else {
      this.setData({
        imgPreMargin: '',
        imgNextMargin: '160rpx'
      })
    }
    if (this.data.imgUrls.length > 2) {
      this.setData({
        imgPreMargin: '80rpx', //banner前面露出的部分
        imgNextMargin: '80rpx'
      })
    }
  },

  //获取分类列表
  getBoxGoodsList: function () {
    let that = this;
    wx.request({
      url: App.data.globalAPI + '/mall/goods/getclass',
      data: {
        token: wx.getStorageSync('token'),
        school_id: wx.getStorageSync('userInfo').school_id
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        const arr = res.data;
        wx.hideLoading();
        if (wx.getStorageSync('firstsupply')==''){
          that.setData({
            showFirstIntro: true
          })
        }
        wx.setStorageSync('firstsupply', true);
        if (arr.error == 0) {
          let first = arr.data.class;
          let dataList = new Array(first.length);
          for (var i = 0; i < first.length; i++) {
            first[i].show = false;
          }
          first[0].show = true; //默认显示第一个分类

          //为每个商品添加购买数量字段
          let list = arr.data.goods;
          for (var k = 0; k < list.length; k++) {
            list[k].buy_num = 0;
          }
          dataList[0] = {
            class: first[0],
            goods: list
          }
          that.setData({
            firstNav: first,
            allListData: dataList,
            listTitle: first[0].cname,//显示的二级标题名称
          })
          if (list.length < 21) {
            that.getGoodsList(first[1].id);
          }
        } else {
          wx.showToast({
            title: arr.msg,
            icon: 'none',
            duration: 800
          })
        }
      }, fail(res) {
        wx.hideLoading();
        that.setData({
          noNetwork: true
        })
      }
    })
  },
  //获取盒子限制
  getBoxLimit: function () {
    let that = this;
    wx.request({
      url: App.data.globalAPI + '/box/attr/getattr',
      data: {
        token: wx.getStorageSync('token'),
        city_id: wx.getStorageSync('userInfo').city_id
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        const arr = res.data;
        if (arr.error == 0) {
          let money = parseFloat(arr.data.box_top_money) - parseFloat(arr.data.total_value)
          that.setData({
            remainPrice: parseFloat(money).toFixed(2),
            originRemainPrice:parseFloat(money).toFixed(2),
            startSend: parseFloat(arr.data.supply_low_money).toFixed(2),
            chaPrice: parseFloat(arr.data.supply_low_money).toFixed(2) 
          })
        } else {
          wx.showToast({
            title: arr.msg,
            icon: 'none',
            duration: 800
          })
        }
      }
    })
  },
  //请求商品信息
  getGoodsList: function (c_id) {
    let that = this;
    wx.request({
      url: App.data.globalAPI + '/mall/goods/getgoods',
      data: {
        class_id: c_id,
        token: wx.getStorageSync('token')
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        const arr = res.data;
        if (arr.error == 0) {
          //为每个商品添加购买数量字段
          let list = arr.data;
          let currentGoodsList = that.data.allListData;
          for (var k = 0; k < list.length; k++) {
            list[k].buy_num = 0;
          }

          let cIndex = that.data.firstIndex + 1;
          if (that.data.allListData[cIndex] != undefined) { //已有数据不重复加载
            return false;
          }
          let newArray = {
            class: that.data.firstNav[cIndex],
            goods: list
          };
          currentGoodsList[cIndex] = newArray;
          that.setData({
            allListData: currentGoodsList,
            firstIndex: cIndex,
          })

          // 左侧导航是否点击
          if (firstClick){
            //获取当前导航位置
            let current = 0;
            that.data.firstNav.forEach((item, i) => {
              if (item.show) {
                current = i;
              }
            })

            for (var s = 1; s <= current; s++) {
              if (that.data.allListData[s] == undefined) {//前面商品列表被跳过时主动加载
                let id = that.data.firstNav[s].id;//要显示的分类id
                that.setData({
                  firstIndex: s-1
                })
                that.getGoodsList(id) //请求商品列表
                break;
              }
            }
            setTimeout(function(){
              if (that.data.heightArr[current - 1] != 0) {
                current--;
              } else {
                for (let n = current; n > 0; n--) {
                  if (that.data.heightArr[n - 1] != 0) {
                    current = n - 1;
                    break;
                  }
                }
              }
              that.setData({
                rightScroll: that.data.heightArr[current] + 40
              })
            },500)           
          }

          if(defaultLoad){ //是否是默认加载数据
            let len = 0;
            for (var i = 0; i < that.data.allListData.length; i++) {
              if(that.data.allListData[i]!=undefined){
                len += that.data.allListData[i].goods.length;
              }
            }
            if (len < 21) {
              that.getGoodsList(that.data.firstNav[cIndex + 1].id);
            }else{
              defaultLoad = false;
            }
          }

          // 更新商品信息
          for (var s = 0; s < that.data.shoppingCart.length; s++) {
            that.changeGoodsList(that.data.shoppingCart[s].goods_id, s);
          }

          let heightArr = [];
          let h = 0;
          //创建节点选择器
          const query = wx.createSelectorQuery();
          //选择id
          query.selectAll('.every').boundingClientRect()
          query.exec(function (res) {
            //res就是 所有标签为contlist的元素的信息 的数组
            res[0].forEach((item) => {
              if(item.height==0){
                heightArr.push(0);
              }else{
                h += item.height;
                heightArr.push(h);
              }  
            })
            that.setData({
              heightArr: heightArr
            })
          })

          wx.hideLoading();
        } else {
          wx.showToast({
            title: arr.msg,
            icon: 'none',
            duration: 800
          })
        }
      }, fail(res) {
        wx.hideLoading();
        wx.showModal({
          title: '提示',
          content: '网络异常，请稍后重试！',
          showCancel: false,
          success(res) {
          }
        })
      }
    })
  },

  // 到底的时候加载数据
  loadMoreListDown:function(){
    let currentIndex = this.data.firstIndex+1;
    if (this.data.allListData[currentIndex]==undefined){
      firstClick = false;
      this.getGoodsList(this.data.firstNav[currentIndex].id);
    } else{
      this.setData({
        firstIndex: currentIndex++
      })
    } 
  },

  // 数量加事件
  onAddHandle: function (e) {
    let fIndex = e.currentTarget.dataset.fatherindex;
    let gIndex = e.currentTarget.dataset.goodindex;
    let currentList = this.data.allListData;
    let goodsMsg = e.currentTarget.dataset.msg;
    let currentCart = this.data.shoppingCart;

    if (parseInt(currentList[fIndex].goods[gIndex].buy_num) >= parseInt(goodsMsg.number)) {
      wx.showToast({
        title: '库存已达上限',
        icon: 'none',
        duration: 800
      })
      return false;
    }
    if (currentCart.length > 0) {//购物车中有商品时
      let flag = false;//判断是否加入过购物车
      for (var i = 0; i < currentCart.length; i++) {
        if (goodsMsg.goods_id == currentCart[i].goods_id) {
          currentCart[i].buy_num ++;
          flag = true;
          break;
        }
      }
      if (!flag) {
        goodsMsg.buy_num ++;
        currentCart.unshift(goodsMsg)
      }
    } else {
      goodsMsg.buy_num ++;
      currentCart.unshift(goodsMsg)
    }

    currentList[fIndex].goods[gIndex].buy_num ++;
    this.setData({
      shoppingCart: currentCart,
      allListData: currentList,
      showHotTip:false
    })
    this.amountShopcart();//计算商品数量和价格
  },
  // 数量减事件
  onSubHandle: function (e) {
    let fIndex = e.currentTarget.dataset.fatherindex;
    let gIndex = e.currentTarget.dataset.goodindex;
    let currentList = this.data.allListData;
    let goodsMsg = e.currentTarget.dataset.msg;
    let currentCart = this.data.shoppingCart;

    for (var i = 0; i < currentCart.length; i++) {
      if (goodsMsg.goods_id == currentCart[i].goods_id) {
        currentCart[i].buy_num--;
        if (currentCart[i].buy_num == 0) {
          currentCart.splice(i, 1)
        }
      }
    }

    currentList[fIndex].goods[gIndex].buy_num--;
    this.setData({
      shoppingCart: currentCart,
      allListData: currentList
    })
    this.amountShopcart();//计算商品数量和价格
  },

  // 计算购物车商品数量和价格
  amountShopcart: function () {
    let list = this.data.shoppingCart;
    let number = 0;
    let money = 0;

    for (var i = 0; i < list.length; i++) {
      number += list[i].buy_num;
      money = parseFloat(money) + parseFloat(list[i].price) * parseFloat(list[i].buy_num);
    }
    this.setData({
      totalNum: number,
      totalMoney: parseFloat(money).toFixed(2),
      remainPrice: parseFloat(this.data.originRemainPrice-money).toFixed(2),
      chaPrice: parseFloat(this.data.startSend - money).toFixed(2)
    })
  },
  // 购物车中商品数量减少
  onSubCartHandle: function (e) {
    let sList = this.data.shoppingCart;
    let cIndex = e.currentTarget.dataset.cindex;
    let cId = e.currentTarget.dataset.id;
    if (sList[cIndex].buy_num > 0) {
      sList[cIndex].buy_num--;
      this.setData({
        shoppingCart: sList
      })
      this.amountShopcart();
      this.changeGoodsList(cId, cIndex);
    }
  },
  //购物车商品增加
  onAddCartHandle: function (e) {
    let sList = this.data.shoppingCart;
    let cIndex = e.currentTarget.dataset.cindex;
    let cId = e.currentTarget.dataset.id;
    let max = e.currentTarget.dataset.max;
    if (sList[cIndex].buy_num >= max) {
      wx.showToast({
        title: '库存已达上限',
        icon: 'none',
        duration: 600
      })
      return false;
    }
    sList[cIndex].buy_num++;
    this.setData({
      shoppingCart: sList
    })
    this.amountShopcart();
    this.changeGoodsList(cId, cIndex);
  },
  // 购物车变化的时候商品列表变化
  changeGoodsList: function (id, index) {
    let list = this.data.allListData;
    let shopCart = this.data.shoppingCart;
    for (var i = 0; i < list.length; i++) {
      if( list[i]!=undefined ){
        for (var j = 0; j < list[i].goods.length; j++) {
          if (list[i].goods[j].goods_id == id) {
            list[i].goods[j].buy_num = shopCart[index].buy_num;
            shopCart[index].number = list[i].goods[j].number;
          }
        }
      }
    }
    this.setData({
      allListData: list,
      shoppingCart: shopCart
    })
  },
  //清空购物车
  clearShopCart: function () {
    let allGoods = [];
    this.data.allListData.forEach((item,i)=>{ //去掉数组中空数组
      if(item!=undefined){
        allGoods.push(item)
      }
    })
    for (var i = 0; i < allGoods.length; i++) {
      for(var j=0;j < allGoods[i].goods.length;j++){
        allGoods[i].goods[j].buy_num = 0;
      }
    }
    this.setData({
      shoppingCart: [],
      hoverAlert: false,
      allListData: allGoods
    })
    this.amountShopcart();
  },
  // 去支付
  goPaymentBlock: function () {
    if (this.data.remainPrice < 0) {
      wx.showToast({
        title: '当前订单超出补货额度',
        icon: 'none',
        duration: 800
      })
    } else if (this.data.totalMoney - this.data.startSend < 0) {
      wx.showToast({
        title: '未达到起送金额',
        icon: 'none',
        duration: 800
      })
      return false;
    }
    else {
      // if (!this.data.hoverAlert) {
      //   this.setData({//购物车列表显示
      //     hoverAlert: true
      //   })
      // } else {
        
      // }
      this.setData({
        hoverAlert:false,
        sureOderMsg:true
      })
    }
  },

  //提交补货单 
  submitReplenishment: function(){
    let that = this;
    let goodsList = that.data.shoppingCart;
    for (var i = 0; i < goodsList.length; i++) {//更新购买商品数量
      if (goodsList[i].buy_num == 0) {//清空商品为0的商品
        goodsList.splice(i, 1);
        i--;
      } else {
        goodsList[i].number = goodsList[i].buy_num;
      }

    }
    wx.request({
      url: App.data.globalAPI + '/order/supply/post',
      data: {
        token: wx.getStorageSync('token'),
        box_id: '',
        goods: JSON.stringify(goodsList)
      },
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 默认值
      },
      success(res) {
        if (res.data.error == 0) {
          const arr = res.data.data;
          if (wx.getStorageSync('allUserMsg').first_supply.order_status!=3){
            var curPageArr = getCurrentPages();
            var page = curPageArr[curPageArr.length - 2];
            page.getTokenLogin();
            page.getButtonStatus();
          }
          
          wx.redirectTo({
            url: 'pay_result?type=replenishment&order_id=' + arr.order_id + '&order_no=' + arr.order_no + '&price=' + arr.price
          })
        } else {
          wx.showToast({
            title: res.data.msg,
            icon: 'none',
            duration: 800
          })
        }
      }, fail(res) {
        wx.showModal({
          title: '提示',
          content: '网络异常，请稍后重试！',
          showCancel: false,
          success(res) {
          }
        })
      }
    })
  },

  // 隐藏确认弹窗
  hiddenDialog:function(){
    this.setData({
      sureOderMsg: false
    })
  },

  // 显示购物车列表
  showShopCart: function () {
    this.setData({
      hoverAlert: true,
    })
  },

  // 关闭弹窗
  showPayModal: function () {
    let list = this.data.shoppingCart;
    for (var i = 0; i < list.length; i++) {//数量为0，关闭时从列表移除
      if (list[i].buy_num == 0) {
        list.splice(i, 1);
        i--;
      }
    }
    this.setData({
      hoverAlert: false,
      shoppingCart: list
    })
  },
  stopHandle: function () {
    return false;
  },

  // 点击一级分类
  onFirstNavHandle: function (e) {
    let that = this;
    let fIndex = e.currentTarget.dataset.firstindex; //点击的一级分类的序号
    let navList = that.data.firstNav; //一级分类列表
    that.setData({ //隐藏最火套餐
      showHotPackage: false
    })
    for (var j = 0; j < navList.length; j++) {
      navList[j].show = false;//隐藏上一个显示样式
    }
    navList[fIndex].show = true;
    let choseId = that.data.firstNav[fIndex].id;//要显示的分类id

    //点击的是已加载数据的分类
    for (var i = 0; i < that.data.allListData.length; i++) {
      if(that.data.allListData[i]!=undefined){
        if (choseId == that.data.allListData[i].class.id) {
          that.setData({
            firstNav: navList,
            listTitle: that.data.firstNav[fIndex].cname,//选中的一级分类标题
            rightScroll: fIndex == 0 ? 0 : (fIndex == 1 ? (that.data.heightArr[0] + 40) : that.data.heightArr[i - 1] + 40),
          })
          return false;
        } 
      }
    }
    //点击的是分类需要加载数据
    wx.showLoading({
      title: '加载中',
    })

    that.setData({
      firstNav: navList,
      firstIndex: fIndex - 1,
      listTitle: that.data.firstNav[fIndex].cname,//选中的一级分类标题
      showHotTip: false
    })
    firstClick = true;
    that.getGoodsList(choseId) //请求商品列表
  },

  //重新加载页面
  refreshPage: function () {
    this.onLoad();
  },

  // 滑动
  listScroll:function(e){
    if(firstClick){
      firstClick = false;
      return false;
    }
    
    let top = e.detail.scrollTop;
    let that = this;
    let navIndex = 0; 
    
    // 判断当前滚动条的位置处于列表的什么位置
    for (var i = 0; i < that.data.heightArr.length; i++) {
      if (top <= that.data.heightArr[0]) {
        navIndex = 0;
      } 
      else if ((top >= that.data.heightArr[i - 1] + 20) && that.data.heightArr[i - 1] != 0) {
        navIndex = (that.data.firstIndex == i) ?that.data.firstIndex: i;
      } 
    }    
    
    //设置导航的当前位置
    let navList = that.data.firstNav; //一级分类列表
    navList.forEach( (item,i)=>{
      (i == navIndex)?(item.show=true):(item.show=false)
    })
    that.setData({
      listTitle: that.data.firstNav[navIndex].cname,
      firstNav: navList,
    }) 

    // 出现滚动条，左边导航的向上移动
    const query = wx.createSelectorQuery();//创建节点选择器
    query.selectAll('.nav-item').boundingClientRect()
    query.exec(function (res) {
      if (navIndex>2){
        that.setData({
          leftScroll: that.data.leftScroll + res[0][0].height
        })
      }else{
        that.setData({
          leftScroll: 0
        })
      }
    })
    that.setData({
      showHotTip: false
    })
  },

  // 最火套餐showHotPackage
  loadHotPacket: function () {
    let that = this;
    wx.request({
      url: App.data.globalAPI + '/mall/goods/getmeal',
      data: {
        token: wx.getStorageSync('token'),
        school_id: wx.getStorageSync('userInfo').school_id
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        const arr = res.data;
        if (arr.error == 0) {
          if (arr.data.length == 0) {
            wx.showToast({
              title: '当前无最火套餐可选',
              icon: 'none',
              duration: 800
            })
          } else {
            for (var i = 0; i < arr.data.length; i++) {
              arr.data[i].num = 0;
            }
            that.setData({
              showHotPackage: true,
              hotPackage: arr.data
            })
          }
        } else {
          wx.showToast({
            title: arr.msg,
            icon: 'none',
            duration: 800
          })
        }
      }, fail(res) {
        wx.showModal({
          title: '提示',
          content: '网络异常，请稍后重试！',
          showCancel: false,
          success(res) {
          }
        })
      }
    })
  },

  // 显示最火套餐详情
  onPackageDetail: function (e) {
    let index = e.currentTarget.dataset.index;
    this.setData({
      showHotDetail: !this.data.showHotDetail,
      hotDetailMsg: this.data.hotPackage[index]
    })
  },

  // 最火套餐的添加
  onPackageAdd:function(e){
    let hotlist = e.currentTarget.dataset.meal;
    let shopCart = this.data.shoppingCart;
    for (var i = 0; i < hotlist.length; i++) {
      hotlist[i].buy_num = parseInt(hotlist[i].number);
    }

    if (shopCart.length == 0) {
      shopCart = hotlist;
    } else {
      shopCart.push(...hotlist);//选中的套餐数组添加到购物车列表
      for (var i = 0; i < shopCart.length - 1; i++) {//合并重复
        for (var j = i + 1; j < shopCart.length; j++) {
          if (shopCart[i].goods_id == shopCart[j].goods_id) {
            shopCart[i].buy_num += shopCart[j].buy_num;
            shopCart.splice(j, 1);
            j--;
          }
        }
      }
      for (var i = 0; i < shopCart.length; i++) {//筛选购买数量超过库存的
        shopCart[i].buy_num = (parseInt(shopCart[i].number - shopCart[i].buy_num) >= 0 ? parseInt(shopCart[i].buy_num) : parseInt(shopCart[i].number));
      }
    }
    wx.showToast({
      title: '套餐添加成功！',
    })
    this.setData({
      shoppingCart: shopCart
    })
    this.amountShopcart();
 
    // 更新商品信息
    for (var s = 0; s < this.data.shoppingCart.length; s++) {
      this.changeGoodsList(this.data.shoppingCart[s].goods_id, s);
    }
  },

  // 隐藏首次引导
  hideFirstIntro:function(){
    this.setData({
      showFirstIntro: false
    })
  }
  
})